#include <stdio.h>

int main ()
{

    FILE* pf1 = fopen ("data.txt" , "w") ;

    if (pf1 = NULL)
    {

        perror ("fopen") ;

        return 1 ;

    }

    fputs ("hello bit\n" , pf1) ;

    FILE* pf2 = fopen ("data_copy.txt" , "w") ;

    if (pf2 == NULL)
    {

        perror ("fopen") ;

        return 1 ;

    }

    char t [20] ;

    fgets (t , 20 , pf1) ;

    fprintf (pf2 , "%s" , t) ;

    fclose (pf1) ;

    pf1 = NULL ;

    fclose (pf2) ;

    pf2 = NULL ;

    return 0 ;

}